/*
 * SVNSecure.java
 *
 * Copyright (c) 2008 Teamnet. All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Teamnet.
 */

package ro.prj.manager.svn;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import ro.prj.manager.constants.SVNConstants;
import ro.prj.manager.util.BundleClReader;

/**
 * This class is used to todo
 */
public class SVNSecure {
    private static Log log = LogFactory.getLog(SVNSecure.class);
    private String dir;
    private String url;
    private String name;
    private String password ;


    public static Log getLog() {
        return log;
    }

    public static void setLog(Log log) {
        SVNSecure.log = log;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }

    public static SVNSecure loadFromBundle(){
        BundleClReader bundleReader=BundleClReader.getInstance(SVNConstants.SVN_CONFIG_PATH);
        SVNSecure ret=new SVNSecure();
        ret.setUrl(bundleReader.getString(SVNConstants.SVN_URI));
        ret.setName(bundleReader.getString(SVNConstants.SVN_USR));
        ret.setPassword(bundleReader.getString(SVNConstants.SVN_PWD));
        ret.setDir(bundleReader.getString(SVNConstants.SVN_DIR_CONFIG));
        return ret;

    }

}
